package com.gopay.bis.dao.payconfig.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.bis.dao.payconfig.BisBankSmallMerchantsDao;
import com.gopay.bis.domain.order.SmallMerchants;
import com.gopay.common.base.dao.impl.BaseDAOImpl;

@Repository("bisBankSmallMerchantsDao")
public class BisBankSmallMerchantsDaoImpl extends BaseDAOImpl<SmallMerchants, String> implements
        BisBankSmallMerchantsDao {

    @Override
    public List<SmallMerchants> getEnableSmallMerchantsByMerId(String merId) {
        String hql = "from SmallMerchants where enable='1' and merId=:merId";
        Map map = new HashMap();
        map.put("merId", merId);
        List<SmallMerchants> list = findByHql(hql, map);
        return list;
    }

    @Override
    public List<SmallMerchants> getEnableSmallMerchantsByMerIdBank(String merId, String bank) {
        String hql = "from SmallMerchants where enable='1' and merId=:merId and remark=:remark";
        Map map = new HashMap();
        map.put("merId", merId);
        map.put("remark", bank);
        List<SmallMerchants> list = findByHql(hql, map);
        return list;
    }

}
